using System;
using System.Collections.ObjectModel;
using PairingMatrix.Services;

namespace PairingMatrix.Model
{
    public class PairModel : BusinessModelBase, IComparable<PairModel>
    {
        private readonly PairingMatrixServiceClient _dataService;
        public PairModel(PairingMatrixServiceClient dataService)
        {
            this._dataService = dataService;
        }

        private ObservableCollection<TeamMemberModel> _members;
        public ObservableCollection<TeamMemberModel> Members
        {
            get { return _members; }
            set
            {
                if (_members == value)
                    return;
                _members = value;
                OnPropertyChanged("Members");
            }
        }

        private ObservableCollection<ProjectCardModel> cards;

        public ObservableCollection<ProjectCardModel> Cards
        {
            get { return cards; }
            set
            {
                if (cards == value)
                    return;
                cards = value;
                OnPropertyChanged("Cards");
            }
        }

        public int CompareTo(PairModel other)
        {
            if (Cards.Count > other.Cards.Count)
                return -1;
            if (Cards.Count < other.Cards.Count)
                return 1;
            return 0;
        }
    }
}